package com.action.library;

import com.bean.library.Term;
import com.dao.DaoManager;
import com.dao.library.TermDao;

public class SGetTermAction {
	public Term getTerm(int grade,String academy,String major){
		DaoManager dm = DaoManager.getInstance();
		TermDao termDao = dm.getDao(TermDao.class);
		Term term = null;
		try
		{
			dm.begin();
			term = termDao.getTermByGradeAndAcademyAndMajor(grade, academy, major);
			dm.commit();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		finally 
		{
			dm.end();
		}
		return term;
	}
}
